package com.example.xd.phone_album

import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.chad.library.adapter.base.BaseQuickAdapter
import kotlinx.android.synthetic.main.select_video_fragment.*


/**
 * @auther XuDan on 2020/8/13.
 */
class SelectVideoFragment : ScanFragment(), BaseQuickAdapter.OnItemClickListener {
    override fun getLayoutId(): Int {
        return R.layout.select_video_fragment
    }

    override fun initView(view: View) {
        fg_video_recycler.layoutManager = GridLayoutManager(context, 4)
        val videoAdapter =
            VideoAdapter(context!!, R.layout.recycler_item_video_layout, scanFileList)
        videoAdapter.setOnItemClickListener(this)
        fg_video_recycler.adapter = videoAdapter
    }

    fun takeVideoSuccess() {}
    fun addNewVideoFile() {}
    fun selectVideo() {}


    override fun getScanType(): Int {
        return MEDIA_TYPE_VIDEO
    }

    override fun onItemClick(adapter: BaseQuickAdapter<*, *>?, view: View?, position: Int) {
        toast(context!!, scanFileList.get(position).path!!)
    }
}